﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.comcast.logging {
    import net.comcast.logging.consoles.*;

    public class Logger {

        private static var level:Number = Level.ALL;
        private static var _console:IConsole;
        private static var consoles:Array = [];

        public static function warn(_arg1, _arg2:String):void{
            log(_arg1, Level.WARN, _arg2);
        }
        public static function error(_arg1, _arg2:String):void{
            log(_arg1, Level.ERROR, _arg2);
        }
        public static function setLevel(_arg1:Number):void{
            level = _arg1;
        }
        public static function fatal(_arg1, _arg2:String):void{
            log(_arg1, Level.FATAL, _arg2);
        }
        public static function info(_arg1, _arg2:String):void{
            log(_arg1, Level.INFO, _arg2);
        }
        private static function log(_arg1, _arg2:Number, _arg3:String):void{
            var _local4:uint;
            if (_arg2 >= level){
                _local4 = 0;
                while (_local4 < consoles.length) {
                    _console = consoles[_local4];
                    _console.log(_arg1, _arg2, _arg3);
                    _local4++;
                };
            };
        }
        public static function debug(_arg1, _arg2:String):void{
            log(_arg1, Level.DEBUG, _arg2);
        }
        public static function removeLogger(_arg1:IConsole):void{
            var _local2:Number;
            _local2 = consoles.indexOf(_arg1);
            if (_local2 == -1){
                throw (new Error("Could not remove item from Array, item doesnt exist in the Array"));
            };
            consoles.splice(_local2, 1);
        }
        public static function getLevel():Number{
            return (level);
        }
        public static function addConsole(_arg1:IConsole):void{
            consoles.push(_arg1);
        }
        public static function set console(_arg1:IConsole):void{
            addConsole(_arg1);
        }

    }
}//package net.comcast.logging 
